<template>
  <div class="share-main">
      <div class="share-model">账号类型：{{userType(isPlusType)}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用模型：{{modelName}}</div>
      <records-list ref="records"
                     :back-color="switchSocketState"
                    :isPlus="isPlusType"
                    :number-key="numberKey" :records-list="recordsList"
                    :nike-name="nikeName"
                    :head-img="headImg"
      ></records-list>
  </div>
</template>

<script>
import recordsList from "@/components/RecordsList";
export default {
  name: "index",
  data(){
    return{
      switchSocketState:true,
      isPlusType:0,
      numberKey:0,
      recordsList:[],
      nikeName:'ME',
      headImg:'',
      modelName:''
    }
  },
  components:{
    recordsList
  },
  created() {
    this.$http.get("/request/open/user/get/share/chatting/"+this.$route.params.code).then(res=>{
      this.recordsList = res.data.data.chattingList[0].requestRecordVoList
      this.isPlusType = Number(res.data.data.userType)
      this.headImg = res.data.data.headImg
      this.modelName = res.data.data.model
      this.numberKey ++
    })
  },
  methods:{
    userType(type){
      if(type === 0){
         return '普通用户'
      }else if (type === 1){
         return '内测用户'
      }else {
        return 'PLUS'+(type-1)
      }
    }
  }
}
</script>

<style scoped>
.share-main{
  width: 100%;
  height: auto;
}
.share-model{
  width: 100%;
  height: 35px;
  background-color: #f7f7f8;
  text-align: center;
  font-size: 15px;
  line-height: 35px;
}
</style>
